#include <iostream>
#include <unistd.h>
#include <memory>
#include "EpollServer.hpp"

using namespace std;

void Usage(const string& proc)
{
    cout << "Usage : " << proc << " port" << endl;
}

// ./epollserver port
int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
    }

    uint16_t port = stoi(argv[1]);

    unique_ptr<EpollServer> ser = make_unique<EpollServer>(port);
    ser->InitServer();
    ser->Loop();

    return 0;
}